<?php

namespace app\index\controller;

use app\BaseController;
use app\Request;
use think\facade\Session;

class Base extends BaseController
{
    public function __construct()
    {
        if (!Session::has('user')) {
            exit("<script>window.location.href='/index/login/index'</script>");
        }
        $this->user = Session::get('user');
        parent::initialize();
       
    }
    public function viewMsg(String $msg)
    {
        return view('error/404', ['msg' => $msg]);
    }
}
